package tree;

import java.util.Stack;

/**
 * @ Author     ：侯耀祖
 * @ Description：
 */
public class countNodes {
    public int countNodes(TreeNode root) {
        if (root == null){
            return 0;
        }
        return countNodes(root.left) + countNodes(root.right) + 1;
    }
}
